﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Painel/MasterPage.master" AutoEventWireup="true" CodeFile="Categoria.aspx.cs" Inherits="Painel_Categoria" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">


<h1>Categoria</h1>

<asp:Label ID="lblMensagem" runat="server" Text="Label" 
            CssClass="msgConfirmacao" Visible="False"></asp:Label>
<br class="clear" />            
 <asp:Panel ID="Panel1" runat="server">
        <div id="divAdicionar">
            <asp:ImageButton ID="btnAdicionar" runat="server" 
            ImageUrl="~/images/btnAdicionar.png" ImageAlign="AbsMiddle" 
                onclick="btnAdicionar_Click" />
        </div>
        <div id="divBusca">
        <asp:Label ID="lblNovo" Text="Digite para consultar:" runat="server" />
        <asp:TextBox ID="txtBusca" runat="server"></asp:TextBox>
        <asp:ImageButton ID="btnBusca" runat="server" 
            ImageUrl="~/images/bt_ok.jpg" onclick="btnBusca_Click" 
                ImageAlign="AbsMiddle" />
        </div>
        <br class="clear" />
        <asp:GridView ID="gvCategoria" runat="server" AllowPaging="True" 
            EnableModelValidation="True" AutoGenerateColumns="False" 
            onpageindexchanging="gvCategoria_PageIndexChanging" 
            onrowcommand="gvCategoria_RowCommand" AllowSorting="True" CellPadding="4" 
            ForeColor="#333333" GridLines="None" Width="100%" HorizontalAlign="Center">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="idCategoria" HeaderText="ID" >
                <HeaderStyle Width="40px" />
                </asp:BoundField>
                <asp:BoundField DataField="Titulo" HeaderText="Título" />
                <asp:TemplateField HeaderText="Alterar" HeaderStyle-Width="60px">
                    <ItemTemplate>
                        <asp:ImageButton ID="btnUpdate" runat="server" 
                            CommandArgument="<%# Bind('idCategoria') %>" CommandName="Alterar" 
                            ImageUrl="~/Images/btn_editar_mini.gif" />
                    </ItemTemplate>
                    <HeaderStyle Width="40px" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Deletar" HeaderStyle-Width="60px">
                    <ItemTemplate>
                        <asp:ImageButton ID="btnDelete" runat="server" 
                            CommandArgument="<%# Bind('idCategoria') %>" CommandName="Remover" 
                            ImageUrl="~/Images/btn_excluir_mini.gif" />
                    </ItemTemplate>
                    <HeaderStyle Width="40px" HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
            </Columns>
            <EditRowStyle BackColor="#7C6F57" />
            <FooterStyle BackColor="#444847" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#444847" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#f9f9f9" />
            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
        </asp:GridView>
        
    </asp:Panel>
    
    <br />
    <asp:Panel ID="Panel2" runat="server">
    <div id="FormPadrao">
        <asp:HiddenField ID="txtCategoria" runat="server" />
        
        <asp:Label ID="lblIdCategoria" runat="server" Text="ID:"></asp:Label>
        <asp:TextBox ID="txtIdCategoria" runat="server" ReadOnly="True" ></asp:TextBox>
        <br />
        <asp:Label ID="lblTitulo" runat="server" Text="Título"></asp:Label>
        <asp:TextBox ID="txtTitulo" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="valTitulo" runat="server" 
            ControlToValidate="txtTitulo" CssClass="campoObrigatorio" 
            ErrorMessage="campo obrigatório!" Width="110px"></asp:RequiredFieldValidator>
        <br />

        <asp:Label ID="Link" runat="server" Text="Link"></asp:Label>
        <asp:TextBox ID="txtLink" runat="server" ></asp:TextBox>
        <br />

        <asp:Label ID="lblOrdem" runat="server" Text="Ordem"></asp:Label>
        <asp:TextBox ID="txtOrdem" runat="server" ></asp:TextBox>
        <br />
        
        <asp:Label ID="Ativo" runat="server" Text="Ativo"></asp:Label>
        <asp:DropDownList ID="ddlAtivo" runat="server">
            <asp:ListItem Value="S">Sim</asp:ListItem>
            <asp:ListItem Value="N">Não</asp:ListItem>
        </asp:DropDownList>
        <br />
        <div id="barraAcao">        
        <asp:ImageButton ID="btnCancelar" runat="server" 
            ImageUrl="~/Images/btnCancelar.png" onclick="btnCancelar_Click" 
            CausesValidation="False" />
        <asp:ImageButton ID="btnSalvar" runat="server" 
            ImageUrl="~/Images/btnSalvar.png" onclick="btnSalvar_Click" />

        </div>
    </div>
    </asp:Panel>
    
    
    </asp:Content>

